package com.example.demo.dao;

import com.example.demo.entity.CommentEntity;
import com.example.demo.vo.CommentVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface CommentDao {
    List<CommentEntity> getCommentsByProductId(@Param("products_id") int products_id);
    List<CommentEntity> getCommentsByUserId(@Param("user_id") int user_id);
    int addComment(@Param("commentVo") CommentVo commentVo);
    int upComment(@Param("commentVo") CommentVo commentVo);
    int delComment(@Param("id") int id);
    CommentEntity getCommentById(@Param("id") int id);
    Double getAverageRatingByProductId(@Param("products_id") int products_id);
    int delCommentUserId(@Param("user_id") int user_id);
}